#include <iostream>
#include <cmath>
using namespace std;

int main() {
    int a,n;
    cin >> a >> n;
    long res;
    res = pow(a, n);
    if (abs(res) > 1000000)
    {
        return 0;
    }
    cout << res;
    
    return 0;
}